package com.cruise.gateway;

import lombok.Builder;
import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * TODO
 *
 * @author Cruise
 * @version 1.0
 * @since 2021/4/5
 */
@RestController
@RequestMapping("/order")
public class OrderController {


    @GetMapping("/get")
    public Order getOrder() {
        return Order.builder().id(1).name("订单1").build();
    }

    @GetMapping("/list")
    public List<Order> getOrders() {
        return Arrays.asList(Order.builder().id(1).name("订单1").build());
    }

    @Data
    @Builder
    public static class Order {
        private int id;
        private String name;

    }
}
